﻿@using SplendidCRM.Ext
@using SplendidCRM.Ext.CCBackendService
@using SplendidCRM.Ext.Helpers

@model IntegrationEnquiryResult


@{
    var formId = Guid.NewGuid();
}

<div id="@formId" class="form-grid">
<div  class="form-header">Result query</div>
<div style="font-size: 10pt;font-weight: bold; font-style:italic"> SUBSCRUBER'S STATE </div>
 <div class="form-section">
        @Html.Field(FieldType.Span, new { fieldLabel = "FirstActiveDate", innerText = @Model.SubscriberState.FirstActiveDate.ToStandardDatetime() })
        @Html.Field(FieldType.Span, new { fieldLabel = "ActiveCAC", innerText = @Model.SubscriberState.ActiveCAC })
        @Html.Field(FieldType.Span, new { fieldLabel = "ActiveStop", innerText = @Model.SubscriberState.ActiveStop.ToStandardDatetime() })
        @Html.Field(FieldType.Span, new { fieldLabel = "SuspendStop", innerText = @Model.SubscriberState.SuspendStop.ToStandardDatetime()})
        @Html.Field(FieldType.Span, new { fieldLabel = "DisableStop", innerText = @Model.SubscriberState.DisableStop.ToStandardDatetime() })
        @Html.Field(FieldType.Span, new { fieldLabel = "LifeCycleState", innerText = @Model.SubscriberState.LifeCycleState })
        @Html.Field(FieldType.Span, new { fieldLabel = "DPFlag", innerText = @Model.SubscriberState.DPFlag })
        @Html.Field(FieldType.Span, new { fieldLabel = "FraudState", innerText = @Model.SubscriberState.FraudState })
        @Html.Field(FieldType.Span, new { fieldLabel = "LossFlag", innerText = @Model.SubscriberState.LossFlag })
        @Html.Field(FieldType.Span, new { fieldLabel = "POSUserState", innerText = @Model.SubscriberState.POSUserState })
        @Html.Field(FieldType.Span, new { fieldLabel = "LockedFlag", innerText = @Model.SubscriberState.LockedFlag })
        @Html.Field(FieldType.Span, new { fieldLabel = "DPEndDate", innerText = @Model.SubscriberState.DPEndDate.ToStandardDatetime() })        
    </div>                     

<div class="clear"></div>

<div style="font-size: 10pt;font-weight: bold; font-style:italic"> SUB ATTACHED INFO </div>
 <div class="form-section">
        @Html.Field(FieldType.Span, new { fieldLabel = "ChgMainProductTimes", innerText = @Model.SubAttachedInfo.ChgMainProductTimes })
        @Html.Field(FieldType.Span, new { fieldLabel = "ChgMainPackageTimes", innerText = @Model.SubAttachedInfo.ChgMainPackageTimes })
        @Html.Field(FieldType.Span, new { fieldLabel = "LastRechargeTime", innerText = @Model.SubAttachedInfo.LastRechargeTime.ToStandardDatetime() })
        @Html.Field(FieldType.Span, new { fieldLabel = "CallBeginTime", innerText = @Model.SubAttachedInfo.CallBeginTime })
        @Html.Field(FieldType.Span, new { fieldLabel = "ServiceStart", innerText = @Model.SubAttachedInfo.ServiceStart.ToStandardDatetime() })
        @Html.Field(FieldType.Span, new { fieldLabel = "ServiceStop", innerText = @Model.SubAttachedInfo.ServiceStop.ToStandardDatetime() })
        @Html.Field(FieldType.Span, new { fieldLabel = "USSDNotifyFlag", innerText = @Model.SubAttachedInfo.USSDNotifyFlag })
        @Html.Field(FieldType.Span, new { fieldLabel = "MSISDN", innerText = @Model.SubAttachedInfo.MSISDN })
        @Html.Field(FieldType.Span, new { fieldLabel = "FraudTimes", innerText = @Model.SubAttachedInfo.FraudTimes })
        @Html.Field(FieldType.Span, new { fieldLabel = "creditmetimes", innerText = @Model.SubAttachedInfo.creditmetimes })        
    </div>                     

<div class="clear"></div>

<div  class="clear" style="font-size: 10pt;font-weight: bold; font-style:italic"> BALANCE RECORD LIST </div>
   <table>
            <thead>
                <tr>
                    <td>BalanceDesc   </td>
                    <td>Balance       </td>
                    <td>MinMeasureId  </td>
                    <td>UnitType      </td>
                    <td>AccountType   </td>
                    <td>ExpireTime    </td>
                    <td>AccountCredit </td>
                    <td>AccountKey    </td>                 
                </tr>
            </thead>
            <tbody>
            @foreach (var p in Model.BalanceRecordList) {
                <tr>
                    <td>@p.BalanceDesc   </td>
                    <td>@p.Balance       </td>
                    <td>@p.MinMeasureId  </td>
                    <td>@p.UnitType      </td>
                    <td>@p.AccountType    </td>
                    <td>@p.ExpireTime.ToStandardDatetime()  </td>
                    <td>@p.AccountCredit </td>
                    <td>@p.AccountKey    </td>                    
                </tr>
                 }
            </tbody>
        </table>
<div class="clear"></div>
<div style="font-size: 10pt;font-weight: bold; font-style:italic"> BILLING CYCLE DATE </div>
 <div class="form-section">
        @Html.Field(FieldType.Span, new { fieldLabel = "BillCycleOpenDate", innerText = @Model.BillingCycleDate.BillCycleOpenDate.ToStandardDatetime() })
        @Html.Field(FieldType.Span, new { fieldLabel = "BillCycleEndDate", innerText = @Model.BillingCycleDate.BillCycleEndDate.ToStandardDatetime() })
        @Html.Field(FieldType.Span, new { fieldLabel = "BillCycleType", innerText = @Model.BillingCycleDate.BillCycleType })
    </div> 
<div class="clear"></div>

<div style="font-size: 10pt;font-weight: bold; font-style:italic"> SUBSCRIBER </div>
<div >
    <div class="form-section">
        @Html.Field(FieldType.Span, new { fieldLabel = "IMSI",  innerText = @Model.SubscriberInfo.Subscriber.IMSI })
        @Html.Field(FieldType.Span, new { fieldLabel = "Code" ,  innerText = @Model.SubscriberInfo.Subscriber.Code})
        @Html.Field(FieldType.Span, new { fieldLabel = "BrandId",  innerText = @Model.SubscriberInfo.Subscriber.BrandId})
        @Html.Field(FieldType.Span, new { fieldLabel = "RegistrationTime",  innerText = @Model.SubscriberInfo.Subscriber.RegistrationTime.ToStandardDatetime()})
        @Html.Field(FieldType.Span, new { fieldLabel = "Lang",  innerText = @Model.SubscriberInfo.Subscriber.Lang})
        @Html.Field(FieldType.Span, new { fieldLabel = "SMSLang",  innerText = @Model.SubscriberInfo.Subscriber.SMSLang})
        @Html.Field(FieldType.Span, new { fieldLabel = "USSDLang", innerText = @Model.SubscriberInfo.Subscriber.USSDLang })
        @Html.Field(FieldType.Span, new { fieldLabel = "PaidMode",  innerText = @Model.SubscriberInfo.Subscriber.PaidMode})
        @Html.Field(FieldType.Span, new { fieldLabel = "InitialCredit",  innerText = @Model.SubscriberInfo.Subscriber.InitialCredit})
        @Html.Field(FieldType.Span, new { fieldLabel = "InitialCreditSpecified",  innerText = @Model.SubscriberInfo.Subscriber.InitialCreditSpecified})
        @Html.Field(FieldType.Span, new { fieldLabel = "BelToAreaID",  innerText = @Model.SubscriberInfo.Subscriber.BelToAreaID})
        @Html.Field(FieldType.Span, new { fieldLabel = "MainProductID",  innerText = @Model.SubscriberInfo.Subscriber.MainProductID})
        @Html.Field(FieldType.Span, new { fieldLabel = "LastRechargeTime",  innerText = @Model.SubscriberInfo.Subscriber.LastRechargeTime.ToStandardDatetime()})
        @Html.Field(FieldType.Span, new { fieldLabel = "LastCallTime",  innerText = @Model.SubscriberInfo.Subscriber.LastCallTime.ToStandardDatetime()})
        @Html.Field(FieldType.Span, new { fieldLabel = "SMSAmount",  innerText = @Model.SubscriberInfo.Subscriber.SMSAmount})
    </div>
    <div  class="clear" style="font-size: 10pt;font-weight: bold; font-style:italic"> PRODUCTS </div>
   <table>
            <thead>
                <tr>
                    <td>Name</td>
                    <td>ProductOrderKey</td>
                    <td>EffectiveDate</td>
                    <td>ExpiredDate</td>
                    <td>Status</td>
                    <td>CurCycleStartTime</td>
                    <td>CurCycleEndTime</td>
                    <td>BillStatus</td>
                   
                </tr>
            </thead>
            <tbody>
            @foreach (var p in Model.SubscriberInfo.Product) {
                <tr>
                    <td>@p.Name </td>
                    <td>@p.ProductOrderKey</td>
                    <td>@p.EffectiveDate.ToStandardDatetime()</td>
                    <td>@p.ExpiredDate.ToStandardDatetime()</td>
                    <td>@p.Status</td>
                    <td>@p.CurCycleStartTime.ToStandardDatetime()</td>
                    <td>@p.CurCycleEndTime.ToStandardDatetime()</td>
                    <td>@p.BillStatus</td>                    
                </tr>
                 }
            </tbody>
        </table>
        </div>
<div  class="clear" style="font-size: 10pt;font-weight: bold; font-style:italic"> SERVICES </div>
   <table>
            <thead>
                <tr>
                    <td>Id</td>
                    <td>Status</td>
                    <td>RegistrationTime</td>                   
                </tr>
            </thead>
            <tbody>
            @foreach (var acc in Model.SubscriberInfo.Service) {
                <tr>
                    <td>@acc.Id </td>
                    <td>@acc.Status</td>
                    <td>@acc.RegistrationTime.ToStandardDatetime()</td>                    
                </tr>
            }
            </tbody>
        </table>
</div>
<script type="text/javascript">
$(function () {
    var model = @Html.Raw(Model.Json(true)) ;
    linq.model(model, '#@formId');
});
</script>
